<script setup lang="ts">
import { ref, inject } from 'vue'
import { useRouter } from 'vue-router'
import ProductWithAction from '@/components/product/ProductWithAction.vue'

const $toast: any = inject('$toast', () => {})
const router = useRouter()


const checked = ref(false)
const onSubmit = () => {
  $toast('结算')
  router.push('/order/preSubmit')
}
</script>
<template>
  <div class="cart">
    <div class="cart-content">
      <ProductWithAction
        v-for="item in 3"
        :key="item" />
    </div>
    <van-submit-bar :price="3050" button-text="去结算" @submit="onSubmit">
      <van-checkbox v-model="checked">全选</van-checkbox>
    </van-submit-bar>
  </div>
</template>
<style lang="scss" scoped>
.cart {
  .cart-content {
    padding-top: 40px;
    padding-bottom: 45px;
    background: linear-gradient(var(--color-background) 0%, var(--vt-c-white) 5%, var(--vt-c-white));
    border-radius: var(--size-border-radius);
    margin: 0 15px;
  }
  .van-submit-bar {
    position: fixed;
    bottom: 100px;
  }
}
</style>